package com.LFLWZ.serviceImpl;

import com.LFLWZ.beans.POJO.ClassroomCourse;
import com.LFLWZ.beans.POJO.LikeRecord;
import com.LFLWZ.beans.POJO.Worksshow;
import com.LFLWZ.beans.Vo.addLike;
import com.LFLWZ.mapper.likeAndWorksMapper;
import com.LFLWZ.mapper.worksMapper;
import com.LFLWZ.service.likeAndWorksService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@Service
public class likeAndWorksServiceImpl implements likeAndWorksService {

    @Autowired
    private likeAndWorksMapper likeAndWorksMapper;
    @Autowired
    private com.LFLWZ.mapper.worksMapper worksMapper;

    @Override
    public int addLike(addLike addLike) {
        return likeAndWorksMapper.addLike(addLike);
    }

    /**
     * 查询用户点赞记录
     *
     * @param
     * @return
     */
    @Override
    public List<LikeRecord> selLike(LikeRecord likeRecord) {
        return likeAndWorksMapper.selLike(likeRecord);
    }

    @Override
    public int deLike(LikeRecord likeRecord) {
        return likeAndWorksMapper.deLike(likeRecord);
    }


    public Worksshow update(Worksshow worksshow) {
        this.worksMapper.update(worksshow);
        return this.worksMapper.sqlById(worksshow.getId());
    }
}
